The Tin Hat
Tahoe-LAFS Tutorial (Part 3) | Running a Storage Node on I2P

Tahoe-LAFS Tutorial (Part 3) | Running a Storage Node on I2P

Category: cloud
A 3 Minute Read

Modified Image By Jason Baker




If you’ve been following along, you’ll know that part one of this series introduced how Tahoe-LAFS broadly works, while part two described exactly how to use Tahoe-LAFS with I2P on Linux. This final segment will describe how to go one step further from simply using Tahoe-LAFS on I2P, to contributing to Tahoe-LAFS on I2P. In other words, it will describe how to set up a Tahoe-LAFS storage node on the I2P network.

Before starting, you will need to have I2P installed, as well as the I2P-variant of Tahoe-LAFS. This is described in part two of the series, so check that out if you haven’t set these up already.

With that groundwork in place, the first step is to create a special server tunnel in I2P so that people using Tahoe-LAFS as a client can connect to it. To do this, simply navigate to the tunnel creation wizard. As you navigate the various menus that this page takes you through, know that you simply need to give your tunnel a name (i.e. ‘tahoe’), leave the host section blank, set the port to whatever you desire (port 8999, for example), and check the AutoStart box. After the tunnel is finally created, check the top green window on the tunnel page, and look for a long string of random letters and numbers that ends in .b32.i2p. This is the address of your tunnel. Copy and paste it into a text editor to make sure it doesn’t get lost.

Next, we need to tell Tahoe-LAFS to create a template for our storage node. We’re going to use the following command, making sure to replace the .b32.i2p address with the one we just copied from our tunnel:


tahoe create-node --listen=tcp --hostname=[YOUR .B32.I2P ADDRESS HERE] -C ~/.tahoe-node

This will create a directly called .tahoe-node that will contain our template. We didn’t necessarily need to specify the directory in that command as Tahoe-LAFS will use .tahoe by default, however that default would cause problems for anyone that already has a Tahoe-LAFS client set up on the same machine.

With the template in place, it is time to make several changes. To open the configuration file with the nano text editor, type into your terminal nano ~/.tahoe-node/tahoe.cfg. Uncomment and edit the following lines, adding in any that don’t already exist:


reveal-ip-address = false
tub.location = i2p:[YOUR .B32.I2P ADDRESS HERE]
tub.port = tcp:[YOUR PORT HERE]:interface=127.0.0.1
introducer.furl = pb://exupps5kk3amc5iq4q6f5ahggkm4s5fl@i2p:oj7cffq5fnk46iw3i3h2sdgncxrqbxm7wh6i4h2cbpmqsydygkcq.b32.i2p/introducer
expire.enabled = true
expire.mode = age
expire.override_lease_duration = 3 month

[i2p]
enabled = true

[connections]
tcp = disabled

Note that the tub.location originally prefaced the .b32.i2p address with tcp:, however we need to change that to i2p:. Additionally, we’ve set up our node to delete any data that hasn’t had its lease renewed in the last three months. To learn about other options for how Tahoe-LAFS deletes old data, give this page a read.

As with the client we created in part two, this is enough to get started. However, it is advisable to add extra introducers to ensure that in the event that our main introducer goes offline, two more are there to fill in the gap. Again, via nano, we will add a file into our .tahoe-node directory with a couple of extra introducers. Enter nano ~/.tahoe-node/private/introducers.yaml into the terminal, and add the following text:


introducers:
  str4d:
    furl: pb://exupps5kk3amc5iq4q6f5ahggkm4s5fl@i2p:oj7cffq5fnk46iw3i3h2sdgncxrqbxm7wh6i4h2cbpmqsydygkcq.b32.i2p/introducer
  zoidberg:
    furl: pb://cys5w43lvx3oi5lbgk6liet6rbguekuo@i2p:sagljtwlctcoktizkmyv3nyjsuygty6tpkn5riwxlruh3f2oze2q.b32.i2p/introducer
  lazygravy:
    furl: pb://5geuzjy6ixwz6nt2awnpcz5yf2xjqqbq@i2p:mmvnzrrj4l5d3iokrsmip5ibkbam7mrcqstjnjrjtpadkh3vbeqq.b32.i2p/twtijyid5sr5cz6punnc3nq6cc6qvzyl

Finally, we can start our node: tahoe start -C ~/.tahoe-node.

To make sure this runs everytime we restart our computer, we’ll add the following crontab using the crontab -e command:


@reboot tahoe start -C ~/.tahoe-node

Share, Follow & Comment